package fr.efrei.international.java.assignment.two;

import java.awt.Color;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import javax.swing.JFrame;
import javax.swing.JTextArea;

public class HelpFrame extends JFrame {
	public HelpFrame() throws Exception {
		super("Help");
		setSize(450, 400);
		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		// show the frame at the center of the screen
		this.setBackground(Color.white);
		JTextArea helpTextArea = new JTextArea();
		helpTextArea.setBounds(79, 59, 309, 147);
		helpTextArea.setEditable(false);
		this.add(helpTextArea);
		String path = "help.txt";
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				new FileInputStream(path), "gbk"));
		String line = null;
		while ((line = reader.readLine()) != null) {
			helpTextArea.append(line + "\n");
		}
		setLocationRelativeTo(null);
		pack();
		setVisible(true);
	}

}
